package design;

public class FinllayTest {


    public static void main(String[] args) {


        int d = test();
        System.out.println(d);

    }

    public static int test() {
        int a = 10;
        int b = 5;
        int c = 0;

        try {
            c = a / b;
            return 10;
        } catch (ArithmeticException e) {
            System.out.println("出现异常：" + e.getMessage());
            e.printStackTrace();
            c = 20;
            return c;
        } finally {
            c = 30;
            System.out.println("finally被执行了");
            System.out.println("c=" + c);
            return c;
        }
    }
}
